package dao

import (
	"fmt"
	"github.com/jinzhu/gorm"
)

type ManualBrand struct {
	Id        int64  `gorm:"primaryKey"`
	BrandName string `gorm:"column:brand_name;type:varchar(255)"`
}

type ManualBrandDao struct {
	db *gorm.DB
}

func NewManualBrandDao(db *gorm.DB) *ManualBrandDao {
	return &ManualBrandDao{db: db}
}

func (f *ManualBrandDao) CreateManualBrand(param *ManualBrand) int64 {
	err := f.db.Create(param).Error
	if err != nil {
		fmt.Print("写入 ManualBrand db错误", err)
	}
	return param.Id
}
